﻿Namespace GestionCalculs

    ''' <summary>
    ''' Implémentation par défaut de <see cref="ICalculCompose" />
    ''' </summary>
    ''' <remarks></remarks>
    Public MustInherit Class CalculCompose
        Inherits FonctionCalculComposee
        Implements ICalculCompose

        ''' <summary>
        ''' 
        ''' </summary>
        ''' <remarks></remarks>
        Protected _resultats As Object

        ''' <summary>
        ''' 
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub New()
            MyBase.New(TypeRecalcul.SurOrdre, Nothing)
            _FonctionCalcul = AddressOf procedureCalcul
        End Sub
        ''' <summary>
        ''' 
        ''' </summary>
        ''' <remarks></remarks>
        Public ReadOnly Property Resultats() As Object Implements ICalculCompose.Resultats
            Get
                Return _resultats
            End Get
        End Property
        ''' <summary>
        ''' 
        ''' </summary>
        ''' <remarks></remarks>
        Public Overrides Sub Calculer(Optional ByVal ForcerCalcul As Boolean = False)
            If EtatCalcul <> ValueEtatCalcul.A_JOUR Or ForcerCalcul = True Then
                MyBase.Calculer()
            End If
        End Sub

        ''' <summary>
        ''' Méthode encapsulant la  logique de calcul
        ''' </summary>
        ''' <remarks></remarks>
        Protected MustOverride Sub ProcedureCalcul()
    End Class

End Namespace
